//
//  WNCache.h
//  Whatnet_iOS
//
//  Created by Bill on 2019/4/22.
//  Copyright © 2019 什么网络. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreLocation/CLLocation.h>

NS_ASSUME_NONNULL_BEGIN

@interface WNCache : NSObject
@property (nonatomic, assign) BOOL forgetPass;

@property (nonatomic, assign) BOOL needLock;

// 初始化
+ (id)shared;

// 返回imageCache目录
+ (NSString *)imageCachesFolder;

// 返回dataCaches目录
+ (NSString *)dataCachesFolder;

// 创建文件夹
+ (BOOL)creatDirectoryPath:(NSString *)path;
+ (NSString *)creatDocSubFolder:(NSString *)folder;
+ (NSString *)creatFolder:(NSString *)folder withPath:(NSString *)path;
// 保存图片
+ (void)saveImage:(UIImage *)image fileName:(NSString *)filename complete:(void (^)(BOOL success, NSString *filePath))block;

// 保存数据
+ (void)saveValue:(id)value forKey:(NSString *)key;
+ (void)saveInteger:(NSInteger)value forKey:(NSString *)key;
+ (void)saveBool:(BOOL)value forKey:(NSString *)key;
+ (void)saveFloat:(float)value forKey:(NSString *)key;
+ (void)saveCoor:(CLLocationCoordinate2D)coor forKey:(NSString *)key;

// 读取数据
+ (id)getValueForKey:(NSString *)key;
+ (NSInteger)getIntegerForKey:(NSString *)key;
+ (BOOL)getBoolForKey:(NSString *)key;
+ (float)getFloatForKey:(NSString *)key;
+ (CLLocationCoordinate2D)getCoorForKey:(NSString *)key;
@end

NS_ASSUME_NONNULL_END
